package com.yuanchuang.yp.mall.web.admin.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanchuang.yp.mall.web.admin.entity.AuthRoleUserRelDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 角色用户关系表 Mapper 接口
 * </p>
 *
 * @author mg-mybatis-generator
 * @since 2019-07-11
 */
public interface AuthRoleUserRelMapper extends BaseMapper<AuthRoleUserRelDO> {
    /**
     * @param authUserId
     * @return
     */
    @Select("SELECT arolerel.* FROM `auth_user`  AS aUser JOIN `auth_role_user_rel` AS arolerel ON aUser.id  = arolerel.`auth_user_id` where aUser.id = ${authUserId}")
    List<AuthRoleUserRelDO> listAuthRoleByAuthUserId(@Param("authUserId") Long authUserId);
}
